package main

import "fmt"

func isRunYear(year int) bool {
	var isRun = false
	if (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0) {
		isRun = true
	}

	return isRun
}

var y, m, mDays int
var yDays int = 365
var ok bool = true
func main() {
	for {
		fmt.Println("->请输入年月,空格隔开")

		fmt.Scan(&y, &m)
		y = int(y)
		m = int(m)
		fmt.Println(m);

		switch m {
		case 1,3,5,7,8,10,12:
			mDays = 31
		case 4,6,9:
			mDays = 30
		case 2:
			if isRunYear(y) {
				mDays = 29
				yDays = 366
			} else {
				mDays = 28
			}
		default:
			ok = false
			fmt.Println("请输入正确的月份")
		}

		if (ok) {
			fmt.Printf("%d年有%d天,%d月有%d天\n", y, yDays, m, mDays)
		}
	}

}
